package com.ruyuan.rapid.core;

import java.util.Random;

public class Bootstrap {

    public static void main(String[] args) {
        //1.加载配置
        RapidConfig rapidConfig = RapidConfigLoader.getInstance().load(args);

        //启动容器
        RapidContainer rapidContainer = new RapidContainer(rapidConfig);
        rapidContainer.start();

        Runtime.getRuntime().addShutdownHook(new Thread(new Runnable() {
            @Override
            public void run() {
                System.out.println("执行容器关闭");
                rapidContainer.shutdown();
            }
        }));
    }
}
